package com.wedata.海康云;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.wedata.HttpUtils;

import java.util.Date;

public class Test extends BaseService{

    public static void main(String[] args) {


    }

    /**
     * 分页查询通行规则信息
     */
    public static String queryRule(){
        JSONObject param = new JSONObject();
        param.set("pageNo",1);
        param.set("pageSize",50);

        /*param.set("projectId", "564924308385480");
        param.set("productCode","1646638166955231");*/

        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/acpmcs/v1/auth/rule/page",header,param);
        //{"code":"200","msg":null,"data":{"total":35,"pageSize":50,"pageNo":1,"list":[{"ruleId":"e684b56bd595028944809ceba9e52fe3","ruleName":"芒果-超级权限","deviceList":[{"rulePartId":"G86395380","rulePartName":"归心苑芒果私教馆-1"},{"rulePartId":"G86395382","rulePartName":"归心苑芒果私教馆-2"}],"orgList":[],"personGroupList":[{"rulePartId":"564390895724296","rulePartName":"归心苑芒果私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"bc524be1ae9a6ede583741a6d8855f1d","ruleName":"门店营业时间-7.00-22.45","deviceList":[{"rulePartId":"G86395380","rulePartName":"归心苑芒果私教馆-1"},{"rulePartId":"G86395382","rulePartName":"归心苑芒果私教馆-2"}],"orgList":[{"rulePartId":"2164837673736880","rulePartName":"WEGYMER健萌"},{"rulePartId":"361013479217840","rulePartName":"默认组织"}],"personGroupList":[],"templateIndex":5,"templateName":"门店时段-七点"},{"ruleId":"b04d40d7d035dd15ae5a7aa57e6d673f","ruleName":"总部负一楼","deviceList":[{"rulePartId":"AE6891584","rulePartName":"碧桂园"},{"rulePartId":"J96243743","rulePartName":"归心苑芒果私教馆-负一楼"}],"orgList":[{"rulePartId":"2164837673736880","rulePartName":"WEGYMER健萌"},{"rulePartId":"361013479217840","rulePartName":"默认组织"}],"personGroupList":[],"templateIndex":1,"templateName":"默认计划模板"},{"ruleId":"676678b192df8d518bae19a186a59943","ruleName":"门店营业时段-7.20-22.40","deviceList":[{"rulePartId":"K45104342","rulePartName":"梅溪湖桃花岭私教馆"}],"orgList":[{"rulePartId":"2164837673736880","rulePartName":"WEGYMER健萌"},{"rulePartId":"361013479217840","rulePartName":"默认组织"}],"personGroupList":[],"templateIndex":6,"templateName":"7_20-22_40"},{"ruleId":"5353f0209881e823bd57e89b3fd22e34","ruleName":"门店营业时段-7.50-22.40","deviceList":[{"rulePartId":"G06771754","rulePartName":"三湘南湖私教馆-2"},{"rulePartId":"J61020446","rulePartName":"南京-江北研创园私教馆"},{"rulePartId":"J81179162","rulePartName":"天健城私教馆"},{"rulePartId":"J81179169","rulePartName":"中建广场私教馆"},{"rulePartId":"J81179170","rulePartName":"喜盈门范城私教馆"},{"rulePartId":"J81179173","rulePartName":"圣爵菲斯香蕉私教馆"},{"rulePartId":"J81179185","rulePartName":"红橡国际广场私教馆"},{"rulePartId":"J81179186","rulePartName":"长沙大道运达私教馆"},{"rulePartId":"J81179191","rulePartName":"星沙尚悦广场私教馆"},{"rulePartId":"J81179192","rulePartName":"南京-奥南私教馆"},{"rulePartId":"J81179198","rulePartName":"南京-徐庄软件园私教馆"},{"rulePartId":"J81179208","rulePartName":"南京-湖南路私教馆"},{"rulePartId":"J81179209","rulePartName":"星城天地私教馆"},{"rulePartId":"J81179210","rulePartName":"楷林国际私教馆-1"},{"rulePartId":"J81179221","rulePartName":"雅颂居私教馆"},{"rulePartId":"J81179224","rulePartName":"仙林金鹰私教馆"},{"rulePartId":"J81179230","rulePartName":"砂子塘私教馆"},{"rulePartId":"J81179233","rulePartName":"梅溪青秀私教馆"},{"rulePartId":"J81179235","rulePartName":"南京-苏宁慧谷私教馆"},{"rulePartId":"J81179238","rulePartName":"马厂龙湾私教馆"},{"rulePartId":"J81179240","rulePartName":"南京-新城科技园私教馆"},{"rulePartId":"J81179241","rulePartName":"树木岭天翼花园私教馆"},{"rulePartId":"J81179242","rulePartName":"楷林国际私教馆-2"},{"rulePartId":"J81179243","rulePartName":"钰龙天下私教馆"},{"rulePartId":"J81179246","rulePartName":"北辰凤凰天阶私教馆"},{"rulePartId":"J81179247","rulePartName":"雨花长沙屿私教馆"},{"rulePartId":"J81179248","rulePartName":"三湘南湖私教馆-1"},{"rulePartId":"J91169810","rulePartName":"洋湖天街私教馆"},{"rulePartId":"J95632116","rulePartName":"南京-中海塞纳丽舍私教馆"},{"rulePartId":"J95632123","rulePartName":"五一广场私教馆-前台"},{"rulePartId":"J95632154","rulePartName":"五一广场私教馆-器械区"},{"rulePartId":"K17573889","rulePartName":"富兴时代私教馆"},{"rulePartId":"K61132218","rulePartName":"旺德府私教馆-1"},{"rulePartId":"K61132231","rulePartName":"旺德府私教馆-2"},{"rulePartId":"K71942936","rulePartName":"麓谷金色梦想私教馆"}],"orgList":[{"rulePartId":"2164837673736880","rulePartName":"WEGYMER健萌"},{"rulePartId":"361013479217840","rulePartName":"默认组织"}],"personGroupList":[],"templateIndex":7,"templateName":"7_30-22_40"},{"ruleId":"56183b4785b1d0291c12320c057f0411","ruleName":"门店营业时段-8.20-22.40","deviceList":[{"rulePartId":"J61020448","rulePartName":"开福万达广场私教馆"},{"rulePartId":"J81179160","rulePartName":"沙湾公园天虹私教馆-3"},{"rulePartId":"J81179188","rulePartName":"中交里城私教馆"},{"rulePartId":"J91169832","rulePartName":"沙湾公园天虹私教馆-2"},{"rulePartId":"J91169872","rulePartName":"沙湾公园天虹私教馆-1"}],"orgList":[{"rulePartId":"2164837673736880","rulePartName":"WEGYMER健萌"},{"rulePartId":"361013479217840","rulePartName":"默认组织"}],"personGroupList":[],"templateIndex":8,"templateName":"7_50-22_40"},{"ruleId":"2c0b888dfd1f7360c45306fa700b457a","ruleName":"星城天地-超级权限","deviceList":[{"rulePartId":"J81179209","rulePartName":"星城天地私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"564952797687560","rulePartName":"星城天地私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"2035b2775197a776f407e9db0048ad69","ruleName":"仙林金鹰私教馆-超级权限","deviceList":[{"rulePartId":"J81179224","rulePartName":"仙林金鹰私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1369651717896","rulePartName":"仙林金鹰私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"23d367cb52a2a46a1a48946307ba10e5","ruleName":"超级权限-长沙","deviceList":[{"rulePartId":"AE6891584","rulePartName":"碧桂园"},{"rulePartId":"G06771754","rulePartName":"三湘南湖私教馆-2"},{"rulePartId":"G86395380","rulePartName":"归心苑芒果私教馆-1"},{"rulePartId":"G86395382","rulePartName":"归心苑芒果私教馆-2"},{"rulePartId":"J61020448","rulePartName":"开福万达广场私教馆"},{"rulePartId":"J81179160","rulePartName":"沙湾公园天虹私教馆-3"},{"rulePartId":"J81179162","rulePartName":"天健城私教馆"},{"rulePartId":"J81179169","rulePartName":"中建广场私教馆"},{"rulePartId":"J81179170","rulePartName":"喜盈门范城私教馆"},{"rulePartId":"J81179173","rulePartName":"圣爵菲斯香蕉私教馆"},{"rulePartId":"J81179185","rulePartName":"红橡国际广场私教馆"},{"rulePartId":"J81179186","rulePartName":"长沙大道运达私教馆"},{"rulePartId":"J81179188","rulePartName":"中交里城私教馆"},{"rulePartId":"J81179191","rulePartName":"星沙尚悦广场私教馆"},{"rulePartId":"J81179209","rulePartName":"星城天地私教馆"},{"rulePartId":"J81179210","rulePartName":"楷林国际私教馆-1"},{"rulePartId":"J81179221","rulePartName":"雅颂居私教馆"},{"rulePartId":"J81179224","rulePartName":"仙林金鹰私教馆"},{"rulePartId":"J81179230","rulePartName":"砂子塘私教馆"},{"rulePartId":"J81179233","rulePartName":"梅溪青秀私教馆"},{"rulePartId":"J81179235","rulePartName":"南京-苏宁慧谷私教馆"},{"rulePartId":"J81179238","rulePartName":"马厂龙湾私教馆"},{"rulePartId":"J81179241","rulePartName":"树木岭天翼花园私教馆"},{"rulePartId":"J81179242","rulePartName":"楷林国际私教馆-2"},{"rulePartId":"J81179243","rulePartName":"钰龙天下私教馆"},{"rulePartId":"J81179246","rulePartName":"北辰凤凰天阶私教馆"},{"rulePartId":"J81179247","rulePartName":"雨花长沙屿私教馆"},{"rulePartId":"J81179248","rulePartName":"三湘南湖私教馆-1"},{"rulePartId":"J91169810","rulePartName":"洋湖天街私教馆"},{"rulePartId":"J91169832","rulePartName":"沙湾公园天虹私教馆-2"},{"rulePartId":"J91169872","rulePartName":"沙湾公园天虹私教馆-1"},{"rulePartId":"J95632123","rulePartName":"五一广场私教馆-前台"},{"rulePartId":"J95632154","rulePartName":"五一广场私教馆-器械区"},{"rulePartId":"K17573889","rulePartName":"富兴时代私教馆"},{"rulePartId":"K45104342","rulePartName":"梅溪湖桃花岭私教馆"},{"rulePartId":"K61132218","rulePartName":"旺德府私教馆-1"},{"rulePartId":"K61132231","rulePartName":"旺德府私教馆-2"},{"rulePartId":"K71942936","rulePartName":"麓谷金色梦想私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1127973407079944","rulePartName":"超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"ce176ca6e95f84c96a03669ff41f8aae","ruleName":"五楼门禁","deviceList":[{"rulePartId":"AC5105796","rulePartName":"五楼门禁-专用"}],"orgList":[],"personGroupList":[{"rulePartId":"681810807112","rulePartName":"五楼门禁"}],"templateIndex":1,"templateName":"默认计划模板"},{"ruleId":"590733da38c08df8ed28c0c8d954ddb2","ruleName":"富兴-超级权限","deviceList":[{"rulePartId":"K17573889","rulePartName":"富兴时代私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1817020376840","rulePartName":"富兴时代私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"4bf5302cf8b1a1b8ddc6825d3d611dc4","ruleName":"五一广场-超级权限","deviceList":[{"rulePartId":"J95632123","rulePartName":"五一广场私教馆-前台"},{"rulePartId":"J95632154","rulePartName":"五一广场私教馆-器械区"}],"orgList":[],"personGroupList":[{"rulePartId":"565092518897416","rulePartName":"五一广场私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"ae4d01accec567abe5cc6e875e65150e","ruleName":"旺德府-超级权限","deviceList":[{"rulePartId":"K61132218","rulePartName":"旺德府私教馆-1"},{"rulePartId":"K61132231","rulePartName":"旺德府私教馆-2"}],"orgList":[],"personGroupList":[{"rulePartId":"1125900967059208","rulePartName":"旺德府私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"1b6e270c73f3337e7b8e4ea73817a9bc","ruleName":"金色梦想-超级权限","deviceList":[{"rulePartId":"K71942936","rulePartName":"麓谷金色梦想私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"564964584361736","rulePartName":"麓谷金色梦想私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"84094118528c23275534c0ca5d337cc4","ruleName":"梅溪湖-超级权限","deviceList":[{"rulePartId":"J81179233","rulePartName":"梅溪青秀私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1833353121544","rulePartName":"梅溪青秀私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"18a91e5839a23441d11924ceb4811792","ruleName":"洋湖天街-超级权限","deviceList":[{"rulePartId":"J91169810","rulePartName":"洋湖天街私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1127658401363720","rulePartName":"洋湖天街私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"ae645b76aa157c64564b8c5e41046d3b","ruleName":"桃花岭-超级权限","deviceList":[{"rulePartId":"K45104342","rulePartName":"梅溪湖桃花岭私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1126286216570632","rulePartName":"梅溪湖桃花岭私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"e38ddd7600a12031622d215ee3976225","ruleName":"长沙大道-超级权限","deviceList":[{"rulePartId":"J81179186","rulePartName":"长沙大道运达私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"945209124616","rulePartName":"长沙大道运达私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"087bfa1b9c19981b3f186871346485df","ruleName":"树木岭-超级权限","deviceList":[{"rulePartId":"J81179241","rulePartName":"树木岭天翼花园私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"2112802694920","rulePartName":"树木岭天翼花园私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"9ed213dc521f3de00c72bca4e168f8af","ruleName":"尚悦-超级权限","deviceList":[{"rulePartId":"J81179191","rulePartName":"星沙尚悦广场私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1126480345736968","rulePartName":"星沙尚悦广场私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"1494b80e3549f2eb5f5b37aaad769116","ruleName":"万达-超级权限","deviceList":[{"rulePartId":"J61020448","rulePartName":"开福万达广场私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1127038758594312","rulePartName":"开福万达广场私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"c22b4f844586c3fec374bf8f5a76deb3","ruleName":"喜盈门-超级权限","deviceList":[{"rulePartId":"J81179170","rulePartName":"喜盈门范城私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1840944686856","rulePartName":"喜盈门范城私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"eb2fe46e51a2cb4e03532e3632e138f9","ruleName":"天虹-超级权限","deviceList":[{"rulePartId":"J81179160","rulePartName":"沙湾公园天虹私教馆-3"},{"rulePartId":"J91169832","rulePartName":"沙湾公园天虹私教馆-2"},{"rulePartId":"J91169872","rulePartName":"沙湾公园天虹私教馆-1"}],"orgList":[],"personGroupList":[{"rulePartId":"563404001158920","rulePartName":"沙湾公园天虹私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"f73eeba9d122916fdc4c767d4b68549c","ruleName":"红橡-超级权限","deviceList":[{"rulePartId":"J81179185","rulePartName":"红橡国际广场私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"564707590842120","rulePartName":"红橡国际广场私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"ee5805aabfc5bcb7a7292524d0448ce9","ruleName":"楷林-超级权限","deviceList":[{"rulePartId":"J81179210","rulePartName":"楷林国际私教馆-1"},{"rulePartId":"J81179242","rulePartName":"楷林国际私教馆-2"}],"orgList":[],"personGroupList":[{"rulePartId":"563511845103368","rulePartName":"楷林国际私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"eff66a01e09c85f3d25e0db7282ad98e","ruleName":"长沙屿-超级权限","deviceList":[{"rulePartId":"J81179247","rulePartName":"雨花长沙屿私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"969276040968","rulePartName":"雨花长沙屿私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"f4b2a8d18e19375127ed520ad27211ff","ruleName":"马厂龙湾-超级权限","deviceList":[{"rulePartId":"J81179238","rulePartName":"马厂龙湾私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"616954504968","rulePartName":"马厂龙湾私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"1ec65e900e6d193a5eb3341bed30cb0f","ruleName":"砂子塘-超级权限","deviceList":[{"rulePartId":"J81179230","rulePartName":"砂子塘私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1786863331080","rulePartName":"砂子塘私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"6e460310158c14fe02c7936b8a832d4e","ruleName":"天健城-超级权限","deviceList":[{"rulePartId":"J81179162","rulePartName":"天健城私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1126168314685192","rulePartName":"天健城私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"b31248f171d252f1daa5a1006db6792e","ruleName":"香蕉馆-超级权限","deviceList":[{"rulePartId":"J81179173","rulePartName":"圣爵菲斯香蕉私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1654474319624","rulePartName":"圣爵菲斯香蕉私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"b460263aaaa019b45275adc1239cc4fa","ruleName":"中交里城-超级权限","deviceList":[{"rulePartId":"J81179188","rulePartName":"中交里城私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1218065377032","rulePartName":"中交里城私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"581522f7945abfe0b6937f36645f49ad","ruleName":"雅颂居-超级权限","deviceList":[{"rulePartId":"J81179221","rulePartName":"雅颂居私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"564025110472456","rulePartName":"雅颂居私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"6ecc2732ae90add7dce4e4dafd637eda","ruleName":"钰龙天下-超级权限","deviceList":[{"rulePartId":"J81179243","rulePartName":"钰龙天下私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1695377172232","rulePartName":"钰龙天下私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"e207daacf15649e3e291aa597d1b4ea8","ruleName":"中建万怡-超级权限","deviceList":[{"rulePartId":"J81179169","rulePartName":"中建广场私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1656521139976","rulePartName":"中建广场私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"},{"ruleId":"f4548123e977c0a2dcf4644b30d7663a","ruleName":"北辰-超级权限","deviceList":[{"rulePartId":"J81179246","rulePartName":"北辰凤凰天阶私教馆"}],"orgList":[],"personGroupList":[{"rulePartId":"1127810556667656","rulePartName":"北辰凤凰天阶私教馆-超级权限"}],"templateIndex":4,"templateName":"超级权限"}]}}
        System.out.println(jsonObject);
        return jsonObject.toString();
    }
    /**
     * 分页查询通行规则信息
     */
    public static String queryRuleInfo(){
        JSONObject param = new JSONObject();
        String[] ruleIds = new String[]{"23d367cb52a2a46a1a48946307ba10e5"};
        /*param.set("projectId", "564924308385480");
        param.set("productCode","1646638166955231");*/

        param.set("ruleIds", ruleIds);

        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/acpmcs/v1/auth/rule/search",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 分页查询设备告警事件(设备上线，下线等事件)
     */
    public static String queryEvent2(){
        JSONObject param = new JSONObject();
        param.set("pageNo",1);
        param.set("pageSize",10);
        param.set("eventStartTime","2024-01-01T21:30:08+08:00");
        param.set("eventEndTime","2024-01-02T21:30:08+08:00");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/aceventcs/v1/acs/event/device/page",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }
    /**
     * 分页查询人员出入事件（这个还没找到在哪里配置的回调地址）
     */
    public static String queryEvent(){
        JSONObject param = new JSONObject();
        param.set("pageNo",1);
        param.set("pageSize",10);
        param.set("eventStartTime","2024-01-01T21:30:08+08:00");
        param.set("eventEndTime","2024-01-02T21:30:08+08:00");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/aceventcs/v1/event/acs/person/page",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 消息查询--无授权
     */
    public static String queryMSg(){
        JSONObject param = new JSONObject();
        param.set("deviceSerial","K61132218");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/global/msg/query/page",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 获取设备远程配置页面地址_适用于添加在产品下设备--无权限
     * @return
     */
    public static String byProductDeviceSerial(){
        JSONObject param = new JSONObject();
        param.set("deviceSerial","K61132218");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/global/remote/url/get/byProductDeviceSerial",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }
    /**
     * 获取设备远程配置页面地址--没有权限
     * @return
     */
    public static String getAdminUrl(){
        JSONObject param = new JSONObject();
        param.set("deviceSerial","K61132218");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/global/remote/url/get",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 3.查询订阅信息
     */
    public static String pageSubscribe(){
        JSONObject param = new JSONObject();
        //param.set("deviceSerial","K61132218");
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/global/sub/list",header,param);

        //{"code":"200","msg":"操作成功","data":{"subInfos":[{"id":"360668725648048","productCode":"1646638166955231","name":"人脸数据","type":"common.subtype.isapi","typeName":"ISAPI通道消息","pushPlatform":0,"pushApp":0,"status":1,"statusName":"启用","msgBreak":1,"msgBreakName":"正常","subUrl":"","pushType":1,"pushTypeName":"加密","password":"","createTime":1646650898112}]}}
        System.out.println(jsonObject);
        return jsonObject.toString();
    }
    /**
     * 3.分页查询事件触发器订阅--无权限
     */
    public static String pageSubscribePage(){
        JSONObject param = new JSONObject();
        param.set("productCode",productCode);
        param.set("subscribeType","common.subtype.isapi");
        param.set("pageNo",1);
        param.set("pageSize",10);
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/eventtrigger/subscribe/page",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 5.获取设备能力集
     */
    public static String getDeviceCapacity(){
        JSONObject param = new JSONObject();
        param.set("deviceSerial","K61132218");
        //{"msg":"操作成功!","code":"200","data":{"support_smart_wifi":"0","support_doorlock_open":"1","ptz_left_right":"0","support_call":"1","support_encrypt":"1","support_talk":"1","support_audio_collect":"1","support_unlock":"1","support_auto_offline":"1","support_wifi_userId":"0","support_isapi":"1","video_quality_capacity":[],"support_modify_pwd":"1","ptz_top_bottom":"0","support_channel_number":1,"support_defence":"1","support_device_wired":"1"}}
        //param.set("deviceSerial","AE6891584");
        //{"msg":"操作成功!","code":"200","data":{"support_smart_wifi":"0","support_doorlock_open":"1","ptz_left_right":"0","support_call":"1","support_encrypt":"1","support_talk":"1","support_audio_collect":"1","support_unlock":"1","support_auto_offline":"1","support_wifi_userId":"0","support_isapi":"1","video_quality_capacity":[],"support_modify_pwd":"1","ptz_top_bottom":"0","support_channel_number":1,"support_defence":"1","support_device_wired":"1"}}
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/global/v1/device/capacity/get",header,param);

        System.out.println(jsonObject);
        return jsonObject.toString();
    }

    /**
     * 查询人员信息
     * @return
     */
    public static String queryPerson(){
        //JSONObject param = new JSONObject();
        JSONObject param = new JSONObject();
        param.set("projectId",projectId);
        param.set("productCode",productCode);
        param.set("status",1);
        param.set("personNum",134413);//邓恺旭
        //{"msg":"","code":"200","data":[{"orgPathId":"/361013479217840/2164837673736880","addressInfo":{"detailInfo":"","areaInfo":""},"cardNums":[],"orgName":"WEGYMER健萌","orgPath":"默认组织/WEGYMER健萌","sex":0,"personNum":"134413","orgId":"2164837673736880","personName":"哈哈","isBackList":0,"faceUrl":"http://93d01acb-yunyao-isapi.oss-cn-hangzhou.aliyuncs.com/photo/2094452232879536.jpg?Expires=1965468016&OSSAccessKeyId=LTAI5t87fYBKrYRHkmXAEyZ9&Signature=xXqgfQs5%2F9Elfqw%2F%2Fu7pO5p7OGA%3D","productCode":"1646638166955231","phone":"","extAcsAuth":{"userVerifyMode":null,"isDelayOpen":0,"openCode":null,"accessAuthority":1},"personId":"2164919224434096","personType":"normal","projectId":"361013479217840","personGroups":[{"groupId":"2164544156610224","groupName":"其他"}],"personLabels":[{"personLabelName":"员工","id":"1126995538341960"}],"status":1}]}
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v1/person/queryPerson",header,param);

        System.out.println(jsonObject);
        //{"code":"200","msg":"","data":[{"projectId":"361013479217840","productCode":"1646638166955231","personId":"564632193957000","personName":"杨明","personNum":"177147","phone":"","orgId":"2164837673736880","orgName":"WEGYMER健萌","orgPath":"默认组织/WEGYMER健萌","orgPathId":"/361013479217840/2164837673736880","personType":"normal","isBackList":0,"extAcsAuth":{"accessAuthority":1,"openCode":null,"userVerifyMode":null,"isDelayOpen":0},"faceUrl":"http://93d01acb-yunyao-isapi.oss-cn-hangzhou.aliyuncs.com/photo/1127506717015176.jpg?Expires=1995505542&OSSAccessKeyId=LTAI5t87fYBKrYRHkmXAEyZ9&Signature=8BrLygytqzq0C%2FaHdljVk%2B%2FN9uU%3D","personGroups":[{"groupId":"2164864897964976","groupName":"开福万达广场私教馆"}],"status":1,"addressInfo":{"areaInfo":"","detailInfo":""},"cardNums":[]}]}
        return jsonObject.toString();
    }


    //查询设备列表--无
    public static String devicePage(){
        JSONArray param = new JSONArray();
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/v2/global/device/page",header,param);

        System.out.println(jsonObject);
        //{"code":"200","msg":"操作成功","data":{"pageNo":1,"pageSize":20,"total":0,"totalPage":0,"list":[]}}
        return jsonObject.toString();
    }

    /**
     * 群组查询(门店，部门，组织)--新增的时候需要自己维护映射关系
     * 表：select * from trade_face_group
     * @return
     */
    public static String personGroup(){
        JSONObject param = new JSONObject();
        param.set("pageNo",1);
        param.set("pageSize",100);
        param.set("productCode",productCode);
        param.set("projectId",projectId);
        JSONObject header = new JSONObject("{\"access_token\":\""+getToken()+"\"}");
        JSONObject jsonObject = HttpUtils.sendPost("https://open.hikyun.com/artemis/api/eits/fdcs/v1/personGroup/page",header,param);

        System.out.println(jsonObject);
        //{"code":"200","msg":"操作成功","data":{"pageNo":1,"pageSize":20,"total":0,"totalPage":0,"list":[]}}
        return jsonObject.toString();
    }




}
